package com.baizhi.chario;

import java.io.*;

/**
 * BufferedReader类提供 了一个方法 readLine() 可以按行读取
 */
public class IOTest {
    public static void main(String[] args) throws IOException {
        /*
        需求： 把当前源代码读取出来并打印到控制台
         */
        FileInputStream fis = new FileInputStream("./javase_io/src/com/baizhi/chario/IOTest.java"); //字节流
        //把字节流转换成字符流
        InputStreamReader isr = new InputStreamReader(fis);
        BufferedReader br = new BufferedReader(isr); //字符流，参数是Writer及其子类

       String line = null;
       while((line = br.readLine())!=null){
           System.out.println(line);
       }

       br.close();
    }
}
